import http from "@/utils/http";

export function getMenuList(params = {}) {
  return http.post("/system/menu/list", params);
}

export function getTreeMenuList(params = {}) {
  return http.post("/system/menu/tree/list", params);
}

export function getMenuDetail(menuId) {
  return http.get(`/system/menu/detail/${menuId}`);
}

export function addMenu(params) {
  return http.post("/system/menu/insert", params);
}

export function updateMenu(params) {
  return http.post("/system/menu/update", params);
}

export function deleteMenu(menuId) {
  return http.post("/system/menu/delete", menuId, {
    headers: {
      "content-type": "application/json",
    },
  });
}

export function deleteBatchMenu(menuIds) {
  return http.post("/system/menu/deleteBatch", menuIds);
}

export function syncUpdateMenu(params) {
  return http.post("/system/menu/update/sync", params);
}
